﻿@model BathhouseService.Models.SqlModels.Notice
@{
    ViewData["Title"] = "详细公告";
    Layout = "~/Areas/WX/Views/Shared/_Layout.cshtml";
}

@section Tops{
    <style type="text/css">
        body {
            background: #FFF;
        }

        .line {
            height: 20px;
        }

        img {
            width: 100%
        }

    </style>
}

<header class="hui-header">
    <div id="hui-back"></div>
    <h1>公告详情</h1>
</header>

<div class="hui-wrap">
    <div class="hui-center-title">
        <h1>@Model.Title</h1>
    </div>
    <div class="hui-content" style="padding:10px;">
        <h2>正文</h2>
        @Html.Raw(Model.Content)

    </div>

    <button type="button" id="plBtn" onclick="Comment('@Model.ID')" class="hui-button hui-button-large hui-primary" style="margin-top:15px;">点击评论</button>


    <div class="hui-common-title" style="margin-top:15px;">
        <div class="hui-common-title-line"></div>
        <div class="hui-common-title-txt">精彩评论</div>
        <div class="hui-common-title-line"></div>
    </div>


    <div class="hui-media-list" style="padding:10px;">
        <ul>
            @foreach (var item in (List<BathhouseService.Models.SqlModels.AnnouncementComments>)ViewBag.AnnouncementComments)
            {
                <li>
                    <div class="hui-media-list-img"><img src="~/images/icon/评论.png" /></div>
                    <div class="hui-media-content">
                        <h1>@item.UpUserName </h1>
                        <p>@item.Content</p>
                        <p>@item.UpTime</p>
                    </div>

                </li>

            }
        </ul>
    </div>


    @*<div class="hui-list" style="margin-top:22px;">
            <ul>

                @foreach (var item in (List<BathhouseService.Models.SqlModels.AnnouncementComments>)ViewBag.AnnouncementComments)
                {
                    <li>



                        <div class="hui-list-text">
                            <div class="hui-list-text-content">
                                @item.UpUserName
                            </div>
                            <div class="hui-list-info">
                                @item.UpTime <span class="hui-icons hui-icons-right"></span>
                            </div>
                        </div>

                    </li>
                    <li>

                        <div class="hui-list-text">
                            <div class="hui-list-text-content">
                                @item.Content
                            </div>
                            <div class="hui-list-info">

                            </div>
                        </div>

                    </li>

                }


            </ul>
        </div>*@


</div>


<div class="hui-fooer-line"></div>
<div id="hui-footer">
    <a href="/WX/Home/Index" id="nav-home">
        <div class="hui-footer-icons hui-icons-home"></div>
        <div class="hui-footer-text">首页</div>
    </a>
    <a href="/WX/Home/Pay" id="nav-news">
        <div class="hui-footer-icons hui-icons-news"></div>
        <div class="hui-footer-text">支付</div>
    </a>
    <div style="width:20%; text-align:center;" class="hui-fl">
        <img src="~/images/jmlogo.jpg" height="44" onclick="hui.back();" />

    </div>
    <a href="/WX/Home/NoticeList" id="nav-forum">
        <div class="hui-footer-icons hui-icons-forum"></div>
        <div class="hui-footer-text">公告</div>
    </a>
    <a href="/WX/Home/PersonalPage" id="nav-my">
        <div class="hui-footer-icons hui-icons-my"></div>
        <div class="hui-footer-text">我的</div>
    </a>
</div>


@section Scripts{
    <script>

        function Comment(id) {

            hui.prompt('请输入您的评论？', ['取消', '确定'], function (context) {

                hui.post(
                    '/WX/Home/Comments',
                    { content: context, id: id },
                    function (msg) {
                        if (msg == 'ok') {
                            hui.alert('评论成功！', '好的', function () { window.location.reload(); });
                        } else {
                            hui.alert(msg, '知道了', function () { window.location.reload(); });
                        }
                    },
                    function (e) {
                        hui.iconToast('读取消息失败', 'warn');
                    }
                );
            });
        }


        hui('#plBtn').click(function () {

        });
    </script>
}



